/*****************************************************
Copyright (C) 2020. All rights reserved.
File name     ：SplayTree.h
Version       ：v1.0
Author        ：zhengqijun
Date          ：2020-03-31
Function List ：
Description   ：Splay Tree(Bottom-up)
******************************************************/

#ifndef SPLAYTREE_H_
#define SPLAYTREE_H_

// Type Definition
struct SplayNode;
typedef int ElementType;
typedef struct SplayNode *Position;
typedef struct SplayNode *SplayTree;

// Function Lists
SplayTree Initialize(void);
SplayTree MakeEmpty(SplayTree T);
int IsEmpty(SplayTree T);
Position Find(ElementType X, SplayTree T);
Position FindMin(SplayTree T);
Position FindMax(SplayTree T);
SplayTree Insert(ElementType X, SplayTree T);
SplayTree Remove(ElementType X, SplayTree T);
Position Left(Position P);
Position Right(Position P);
ElementType Retrieve(Position P);
void PreorderTraversal(SplayTree T);
void InorderTraversal(SplayTree T);
void PostorderTraversal(SplayTree T);
void LevelorderTraversal(SplayTree T);

#endif  /* SPLAYTREE_H_ */

// EOF

